<?php echo $this->Html->css("prettyPhoto") ;?>
<?php echo $this->Html->script("jquery.prettyPhoto_s") ;?>
<script type="text/javascript">
	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto();
	});
</script>
<div class="main-content">
      <div class="left-panel"></div>
      <div class="panel">
        <?php echo $this->element("backend/left_menu");?> 
        <div class="content">
          <div class="title">
             <h2 class="t1">Quản lý thông tin banner website</h2>
          </div>
             <?php echo $this->session->flash(); ?>
          <form action="" id="table-list-admin-form">
            <div class="top_action">
                <br />
                <input type="text" value="" class="searh_input" placeholder="  Tìm kiếm"/>
                <a class="btnsearch"><span>Search</span></a>
              
                <a href="<?php echo $this->Html->url("/banners/admin_add");?>" class="add"><span>Add</span></a>
                    
                      </div> 
                       <br />
            <table cellspacing="0" cellpadding="0" class="display" id="table-list-admin">
              <thead>
                <tr class="header">
                  <th class="order" width="5%">
                    <a href="#">#</a>
                  </th>
                  <th class="left">
                    <a href="">Image</a>
                  </th>
                  <th>
                    <a href="">Banner Name</a>
                  </th>
                  
                  <th>Actions</th>
                </tr>
              </thead>
              <tbody>
              <?php  
              $i =1;  
              foreach ($banners as $k => $v ) {?>
                <tr>
                  <td><?php echo $i++; ?></td>
                  <td>
					<a rel="prettyPhoto" href="<?php echo $v['Banner']['full_path'];?>" >
						<img src="<?php echo $v['Banner']['full_path'];?>" width="50" height="50" />
					</a>
				  </td>
                  <td><?php echo h($v['Banner']['banner_name']) ; ?> </td>
                  <td class="action" nowrap >
                    <a class="edit" title="Edit" href="<?php echo $this->Html->url("/Banners/admin_edit/".$v['Banner']['id']); ?>" >Edit</a>
                    <a class="delete" href="<?php echo $this->Html->url("/Banners/admin_delete/".$v['Banner']['id']); ?>" title="Delete" onclick="return confirm('Are you sure you want to delete<?php echo $v["Banner"]['banner_name'] ?> ');">Delete</a>
                  </td>
                </tr>
                <?php } ?>
                
              </tbody>
            </table>
          </form>
          <br />
          <div>
                <?php   echo $this->Paginator->prev('',array('tag'=>'a','class' => 'page-far-left','id'=>'prev'),'', array('tag'=>'a','class' => 'page-far-left','id'=>'prev')); ?>
                   <div id="page-info">Page 
                    <strong><?php echo $this->request->params['paging']['Banner']['page'] ?>
                    </strong>/ <?php echo $this->request->params['paging']['Banner']['pageCount'] ?>
                  </div>
                 <?php echo $this->Paginator->next("",array('tag'=>'a','class' => 'page-far-right','id'=>'next'), null, array('tag'=>'a','class' => 'page-far-right','id'=>'next')); ?>
                  
          </div>
         
        </div>
      </div>
      <div class="right-panel"></div>
      <!-- main.end -->
    </div>
    <script>
    $(".page-far-left").click(function(){
        
       window.location.href=document.getElementById('prev').href;
    });
    $(".page-far-right").click(function(){
        
       window.location.href=document.getElementById('next').href;
    });
    </script>